//
//  UITableView+Registe.swift
//  Poetry
//
//  Created by cheyongzi on 2023/12/14.
//

import UIKit

extension UITableView{
    func registeXIBS(_ xibs: [String]){
        xibs.forEach { xibName in
            self.register(UINib.init(nibName: xibName, bundle: nil), forCellReuseIdentifier: xibName)
        }
    }
    
    func registeHeaderXIBS(_ xibs: [String]){
        xibs.forEach { xibName in
            self.register(UINib.init(nibName: xibName, bundle: nil), forHeaderFooterViewReuseIdentifier: xibName)
        }
    }
    
    func registeClasses(_ classNames: [String]){
        classNames.forEach { className in
            self.register(className.Class, forCellReuseIdentifier: className)
        }
    }
    
    func registeHeaderClasses(_ classNames: [String]){
        classNames.forEach { className in
            self.register(NSClassFromString(className), forHeaderFooterViewReuseIdentifier: className)
        }
    }
}
